package com.atguigu.client;

import com.atguigu.entity.CartInfo;
import com.atguigu.result.RetVal;
import com.atguigu.search.SearchParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "shop-cart")//, fallback = ProductFallback.class)
public interface CartFeignClient {

    @PostMapping("/cart/addToCart/{skuId}/{skuNum}")
    public RetVal addToCart(@PathVariable Long skuId, @PathVariable Long skuNum);

    //5.查询选中的商品信息---送货清单
    @DeleteMapping("/cart/getSelectedProduct/{userId}")
    public List<CartInfo> getSelectedProduct(@PathVariable String userId);

    //6.从数据库中查询最新的购物车信息到redis中
    @DeleteMapping("/cart/queryFromDbToRedis/{userId}")
    public List<CartInfo> queryFromDbToRedis(@PathVariable String userId);

}
